/* -------------------------------- */
/* 控制菜单滚动 */

$(function () {
    $('#main_button_min').hover(function () {
        $('#main_button_list_v2').slideDown(0);
    }, function () {
        $('#main_button_list_v2').slideUp(0);
    });
    $('#arrow_right').click(function () {
        var tabid = $('div.RibbonTabActive').attr('TabID');
        var lm = parseInt($("div[TabContentID=" + tabid + "]").css('margin-left'));
        var w = 0;
        $.map($("div[TabContentID=" + tabid + "] div.RibbonGroupContent"), function (e, i) {
            w += $(e).width();
            return 1;
        });
        if (w + lm >= $("div[TabContentID=" + tabid + "]").parent().width()) {
            var btn = $(this).css('visibility', 'hidden');
            $("div[TabContentID=" + tabid + "]").animate({ marginLeft: '-=115' }, 500, function () {
                btn.css('visibility', 'visible');
            });
        }
    });

    $('#arrow_left').click(function () {
        var tabid = $('div.RibbonTabActive').attr('TabID');
        var ml = $("div[TabContentID=" + tabid + "]").css('margin-left');
        if (ml != '0px') {
            var btn = $(this).css('visibility', 'hidden');
            $("div[TabContentID=" + tabid + "]").animate({ marginLeft: '+=115' }, 500, function () {
                btn.css('visibility', 'visible');
            });
        }
    });
});

function toggleshow() {
};
function scrolllast() {
};

